<?php foreach ($all_post as $key => $post) {
            ?>

                <?php if(isset($post['post_id'])) { ?><!--post-->

                <li>
                    <?php 
                        $temp = json_decode($post['upload_image']);
                        $image_filename = $temp[0];
                    ?>
                <img src="<?php echo $this->config->item('image_uploader_thumbs','layout').'/'.$post['user_id'].'/'.$image_filename; ?>" width="200" height="150" />
                <!--
                <div class="btn_memberLike">123,456,789</div>
                
                <div class="btn_sharefb"></div>
                -->
                <div class="btn_collect"><span>/post/detail/<?php echo $post['post_id'].'/'; ?></span></div>
                <?php if(isset($keyword)){ ?>
                    <a href="/post/detail/<?php echo $post['post_id'].'/'; ?><?php echo '?q='.urlencode($keyword); ?>">
                <?php }elseif(isset($category_id)){ ?>
                    <a href="/post/detail/<?php echo $post['post_id'].'/'; ?><?php echo '?c='.$category_id; ?>">
                <?php }else{ ?>
                    <a href="/post/detail/<?php echo $post['post_id']; ?>">
                <?php } ?>
                <div class="photoListInfo_01">
                <?php echo $post['post_excerpt'] ?>
                </div></a></li>
                <?php }elseif(isset($post['topic_id'])){ ?>  <!--topic-->

                    <li>
                        <?php if($post['topic_category'] == '案例分享'){ ?>
                            <div class="indexTitle_03">
                        <?php }elseif($post['topic_category'] == '人物訪談'){ ?>
                            <div class="indexTitle_02">
                        <?php }else{ ?>
                            <div class="indexTitle_01">
                        <?php } ?>
                        <?php echo $post['topic_category']; ?></div>
                        <?php
                            $doc = new DOMDocument();
                            @$doc->loadHTML($post['topic_desc']);
                            $first_img = $doc->getElementsByTagName('img')->item(0);
                            $first_img_src = $first_img->attributes->getNamedItem("src")->value;
                        ?>
                        <img src="<?php echo $first_img_src; ?>" width="200" height="150" />
                        <div class="btn_collect"><span>/topic/detail/<?php echo $post['topic_id'].'/'; ?></span></div>
                        <a href="/topic/detail/<?php echo $post['topic_id'].'/'; ?>">
                        <div class="photoListInfo_06"><?php echo $post['topic_excerpt']?></div></a>
                    </li>
                <?php } ?>
                
            <?php } ?>